package com.tank;

/**
 * @Hero:我们自己的坦克
 *
 */
public class Hero  extends Tank {
    //子弹
    private Shot shot=null;

    public Shot getShot() {
        return shot;
    }

    public void setShot(Shot shot) {
        this.shot = shot;
    }

    public Hero(int x, int y) {
        super(x, y);
    }

    //射击
    public void shotEnemy(){
        //创建shot对象,根据direct来确定x,y坐标
        switch(getDirect()){
            case 0:
                shot=new Shot(getX()+20,getY()-10,0);
                break;
            case 1:
                shot =new Shot(getX()+70,getY()+20,1);
                break;
            case 2:
                shot=new Shot(getX()+20,getY()+70,2);
                break;
            case 3:
                shot=new Shot(getX()-10,getY()+20,3);
        }
        new Thread(shot).start();
    }
}
